<template>
  <div class="body">
    <!-- 标题 -->
    <v-head></v-head>
    <!-- 高级检索 -->
    <Row class="restand">
        <i-col class="standkepu" span="22">
          <div class="detail">
            <div class="standtitle">{{ standname }}</div>
            <div class="standentitle">{{ enname }}</div>
            <div class="standnum">
              <Tag color="success" v-if="StandStatus==='现行'">现行</Tag>
              <Tag color="error" v-else-if="StandStatus==='废止'">废止</Tag>
            </div>
            <div class="standfenge1"></div>
            <div class="standmiaoshu">适用范围:&#12288;&#12288;{{scope}}</div>
            <!-- <div >
              <Row class="mulurow">
                <i-col class="mululeft" span="3">
                  目录
                </i-col>
                <i-col class="muluright" span="14">
                  <Anchor :affix="false" show-ink>
                      <AnchorLink href="#one" title="1 标准状态" />
                      <AnchorLink href="#two" title="2 基础信息" />
                      <AnchorLink href="#three" title="3 备案信息"/>
                      <AnchorLink href="#four" title="4 相近标准"/>
                  </Anchor>
                </i-col>
              </Row>
            </div> -->
            <div class="shijiantitle" >标准状态</div>
            <!-- <h5 class="module-title">
              <span>
                <b>标准状态</b>
              </span>
            </h5> -->
            <div class="shijianzhous">
              <Timeline>
                <TimelineItem color="green" v-if="isd!=''">发布于&#12288;{{isd}}</TimelineItem>
                <TimelineItem color="green" v-if="efd!=''">实施于&#12288;{{efd}}</TimelineItem>
                <TimelineItem color="red" v-if="AbolitionDate!=''">废止于&#12288;{{AbolitionDate}}</TimelineItem>
              </Timeline>
            </div>
            <!-- <div class="jichutitle" >基础信息</div> -->
            <h5 class="module-title">
              <span>
                <b>基础信息</b>
              </span>
            </h5>
            <div class="shijianzhou">
              标准号&#12288;&#12288;{{ standnum }}
              <span class="jichuitem">中国标准分类号&#12288;&#12288;{{ ccs }}</span>
            </div>
            <div class="shijianzhou">
              发布日期&#12288;&#12288;{{ isd }}
              <span class="jichuitem">国际标准分类号&#12288;&#12288;{{ ics }}</span>
            </div>
            <div class="shijianzhou">
              实施日期&#12288;&#12288;{{ efd }}
              <span class="jichuitem">页数&#12288;&#12288;{{ standardPages }}</span>
              <!-- <span class="jichuitem" v-if="DraftingUnit!=null && DraftingUnit!=''">起草单位&#12288;&#12288;{{ DraftingUnit }}</span> -->
            </div>
            <div class="shijianzhou" v-if="AbolitionDate!=''">
              废止日期&#12288;&#12288;{{ AbolitionDate }}
            </div>
            <div class="shijianzhou" v-if="DraftingPeople!=''">
              起草人&#12288;&#12288;<a class="sdfpe" v-for="item in DraftingPeople" @click="geDraftPeo(item)" :key="item">{{item}}</a>
            </div>
            <div class="shijianzhou" v-if="DraftingUnit!=''">
              起草单位&#12288;&#12288;<a class="sdfpe" v-for="item in DraftingUnit" :key="item" @click="getDraftUtil(item)">{{item}}</a>
            </div>
            <div class="shijiantitle" v-if="substitutedStandard!=null && substitutedStandard!='' && substitutedStandard!=' '">替代以下标准</div>
            <div class="shijianzhous" v-if="substitutedStandard!=null && substitutedStandard!='' && substitutedStandard!=' '">
              {{substitutedStandard}}被替代
            </div>
            <!-- <div class="jichutitle" >规范性引用文件</div>
            <div class="shijianzhoux" v-for="item in childlist" :key="item">
              <span v-if="item.type==='1'">规范性引用条目&#12288;&#12288;{{ item.n_docum }}</span>
            </div>
            <div class="jichutitle" >附录</div>
            <div class="shijianzhoux" v-for="item in childlist" :key="item">
              <span v-if="item.type==='2'">附录条目编号&#12288;&#12288;{{ item.app_id }}&#12288;&#12288;附录条目内容&#12288;&#12288;{{ item.app_body }}</span>
            </div>
            <div class="jichutitle" >参考文献</div>
            <div class="shijianzhoux" v-for="item in childlist" :key="item">
                <span v-if="item.type==='3'">参考文献条目&#12288;&#12288;{{ item.ref_item }}</span>
            </div>
            <div class="jichutitle" >术语</div>
            <div class="shijianzhoux" v-for="item in childlist" :key="item">
              <span v-if="item.type==='4'">
                条目编号&#12288;&#12288;{{ item.t_id }}&#12288;&#12288;
                术语名称&#12288;&#12288;{{ item.t_cn }}&#12288;&#12288;
                英文名称&#12288;&#12288;{{ item.t_en }}&#12288;&#12288;
                术语定义&#12288;&#12288;{{ item.t_def }}&#12288;&#12288;
                注&#12288;&#12288;{{ item.t_note }}&#12288;&#12288;
                例&#12288;&#12288;{{ item.t_exp }}&#12288;&#12288;
                图表&#12288;&#12288;{{ item.pic }}&#12288;&#12288;
              </span>
            </div>
            <div class="jichutitle" >目次</div>
            <div class="shijianzhoux" v-for="item in childlist" :key="item">
              <span v-if="item.type==='5'">目次条目编号&#12288;&#12288;{{ item.clg_id }}&#12288;&#12288;目次条目内容&#12288;&#12288;{{ item.clg_name }}</span>
            </div>
            <div class="jichutitle" >结构化信息</div>
            <div class="shijianzhoux" v-for="item in childlist" :key="item">
              <span v-if="item.type==='6'" >
                章节编号&#12288;&#12288;{{ item.tech_itid }}&#12288;&#12288;
                章节标题&#12288;&#12288;{{ item.tech_itname }}&#12288;&#12288;
                二级编号&#12288;&#12288;{{ item.tech_paraid }}&#12288;&#12288;
                二级题目&#12288;&#12288;{{ item.tech_paraname }}&#12288;&#12288;
                三级编号&#12288;&#12288;{{ item.tech_ptid }}&#12288;&#12288;
                三级题目&#12288;&#12288;{{ item.tech_ptname }}&#12288;&#12288;
                技术内容&#12288;&#12288;{{ item.tech_ptbody }}&#12288;&#12288;
                图表&#12288;&#12288;{{ item.tech_pic }}&#12288;&#12288;
              </span>
            </div> -->
            <!-- <div class="jichutitle" v-if="this.xiangsilist.length != 0" >相似标准</div> -->
            <h5 v-if="this.xiangsilist.length != 0" class="module-title">
              <span>
                <b>相似标准</b>
              </span>
            </h5>
            <div class="xiansi" v-for="(item,index) in xiangsilist" :key="index">
              <div class="xiangsibz" @click="getXs(item.Id)">
                <Icon type="ios-link" />
                {{item.Cn}}
                {{item.StandNum}}
              </div>
            </div>
            <!-- <div v-if="this.childrenlist" class="jichutitle" >规范性引用文件</div> -->
            <h5 v-if="this.childrenlist" class="module-title">
              <span>
                <b>规范性引用文件</b>
              </span>
            </h5>
            <div class="jiegouhuaxianshi" v-for="(item,index) in childrenguifan" :key="'info'+index">
              <div v-if="item.type==1" @click="getGuifan(item.n_docum)" class="jghwzguifan">
                {{item.n_docum}}
              </div>
            </div>
            <!-- <div v-if="this.childrenlist" class="jichutitle" >附录</div> -->
            <h5 v-if="this.childrenlist" class="module-title">
              <span>
                <b>附录</b>
              </span>
            </h5>
            <div class="jiegouhuaxianshi" v-for="(item,index) in childrenfulu" :key="'infof'+index">
              <div v-if="item.type==2" class="jghwz">
                {{item.app_body}}
                {{item.app_id}}
              </div>
            </div>
            <!-- <div v-if="this.childrenlist" class="jichutitle" >参考文献</div> -->
            <h5 v-if="this.childrenlist" class="module-title">
              <span>
                <b>附录</b>
              </span>
            </h5>
            <div class="jiegouhuaxianshi" v-for="(item,index) in childrenlist" :key="'infoc'+index">
              <div v-if="item.type==3" class="jghwz">
                {{item.ref_item}}
              </div>
            </div>
            <!-- <div v-if="this.childrenlist" class="jichutitle" >术语</div> -->
            <h5 v-if="this.childrenlist" class="module-title">
              <span>
                <b>附录</b>
              </span>
            </h5>
            <div class="jiegouhuaxianshi" v-for="(item,index) in childrenshuyu" :key="'infos'+index">
              <div v-if="item.type==4" class="jghwz">
                {{item.t_cn}}
                {{item.t_def}}
                {{item.t_en}}
                {{item.t_exp}}
                {{item.t_id}}
                {{item.t_note}}
              </div>
            </div>
            <!-- <div v-if="this.childrenlist" class="jichutitle" >目次</div> -->
            <h5 v-if="this.childrenlist" class="module-title">
              <span>
                <b>目次</b>
              </span>
            </h5>
            <div class="jiegouhuaxianshi" v-for="(item,index) in childrenmuci" :key="'infom'+index">
              <div v-if="item.type==5" class="jghwz">
                {{item.clg_id}}
                {{item.clg_name}}
              </div>
            </div>
            <!-- <div v-if="this.childrenlist" class="jichutitle" >结构化内容</div> -->
            <h5 v-if="this.childrenlist" class="module-title">
              <span>
                <b>结构化内容</b>
              </span>
            </h5>
            <div class="jghwzjiegou">
              <Tree :data="baseData"></Tree>
            </div>
            <!-- <div class="jiegouhuaxianshi" v-for="(item,index) in childrenjiegou" :key="'infoji'+index">
              <div v-if="item.type==6" class="jghwz">
                {{item.tech_itid}}
                {{item.tech_itname}}
                <br>
                {{item.tech_pic}}
                {{item.tech_ptbody}}
              </div>
            </div> -->
            <!-- <div v-if="this.childList.length !== 0" class="jichutitle" >附录</div>
            <div class="xiansi" v-for="(item,index) in childlist" :key="index">
              <div class="xiangsibz" @click="getXs(item.Id)">
                {{item.app_body}}
                {{item.app_id}}
                {{item.clg_id}}
                {{item.clg_name}}
                {{item.n_docum}}
                {{item.pic}}
                {{item.ref_item}}
                {{item.t_cn}}
                {{item.t_def}}
                {{item.t_en}}
                {{item.t_exp}}
                {{item.t_id}}
                {{item.t_note}}
                {{item.tableName}}
                {{item.tech_itid}}
                {{item.tech_itname}}
                {{item.tech_level}}
                {{item.tech_pic}}
                {{item.tech_ptbody}}
              </div>
            </div> -->
            <!-- <div class="jichutitle" v-if="this.childList.length > 0">参考文献</div>
            <div class="jichutitle" v-if="this.childList.length > 0">术语</div>
            <div class="jichutitle" v-if="this.childList.length > 0">目次</div>
            <div class="jichutitle" v-if="this.childList.length > 0">结构化</div> -->
          </div>
        </i-col>
    </Row>
    <ButtonGroup v-if="this.categorycode!='N'" id="test" class="shopcarbtn" vertical>
        <p type="success" size="small" @click="readpdf" class="rightgetarticle"><Icon type="ios-book-outline" size="20"></Icon><br>预<br>览</p>
        <p type="success" size="small" @click="addshopcar" v-show="!isbuy" class="rightbtn"><Icon size="20" type="ios-cart-outline"></Icon><br>加<br>入<br>购<br>物<br>车</p>
        <p type="info" size="small" @click="downpdf" v-show="isbuy"  class="downbtn"><Icon type="ios-arrow-thin-down"></Icon><br>下<br>载<br>全<br>文</p>
        <!-- <p type="warning" size="small" @click="qq" class="downbtn"><Icon custom="iconfont icon-qq" size="20"></Icon><br>Q<br>Q</p>
        <p type="warning" size="small" @click="weibo" class="downbtn"><Icon custom="iconfont icon-weibo" size="20"></Icon><br>微<br>博</p> -->
        <!-- <a href="http://192.168.1.122:8099/gn/GB/20000-22000/GB%2036886-2018.pdf" download="文件名">1111</a> -->
        <!-- <p type="info" size="small" @click="downpdf" class="downbtn">test</p> -->
    </ButtonGroup>
    <!-- <Badge :count="shopcount" class="shopcar">
        <router-link class="demo-badge" target="_blank" :to="'/shopcar'"><Icon color="#3969af" size="50" type="ios-cart"></Icon></router-link>
    </Badge> -->
    <div id="purchaseManage"></div>
    <!-- 底部 -->
    <v-foot></v-foot>
    <Back-top></Back-top>
  </div>
</template>
<script>
import {neturl} from '../assets/js/common'
export default {
  name: 'seniorsearch',
  data () {
    return {
      msg: '内蒙古标准文献服务平台',
      theme1: 'light',
      byname: 'bymenu',
      standname: '',
      standnum: '',
      isd: '',
      efd: '',
      DraftingUnit: [],
      DraftingPeople: [],
      PublishingUnit: '',
      RecordNumber: '',
      AbolitionDate: '',
      xiangsilist: [],
      id: '',
      keyword: '',
      islogin: false,
      islog: true,
      username: '',
      userinfo: '',
      standard: '',
      standardPages: '',
      shopcount: 0,
      enname: '',
      StandStatus: '',
      scope: '',
      ccs: '',
      ics: '',
      substitutedStandard: '',
      isbuy: false,
      textaddress: '',
      childrenlist: [],
      childrenguifan: [],
      childrenfulu: [],
      childrenshuyu: [],
      childrenmuci: [],
      childrenjiegou: [],
      categorycode: '',
      baseData: [],
      org: ''
    }
  },
  computed: {
  },
  watch: {
    // childrenlist (newValue, oldValue) {
    //   this.childrenguifan = sortKey(newValue, 'n_docum')
    //   this.childrenfulu = sortKey(newValue, 'app_id')
    //   this.childrenshuyu = sortKey(newValue, 't_id')
    //   this.childrenmuci = sortKey(newValue, 'clg_id')
    //   this.childrenjiegou = sortKey(newValue, 'tech_itid')
    // }
  },
  methods: {
    // 跳转规范性引用文件
    getGuifan (guifan) {
      let guifanarry = guifan.split(' ')
      let routeUrl = this.$router.resolve({path: '/seniorsearch', query: {keyword: guifanarry[0] + ' ' + guifanarry[1]}})
      window.open(routeUrl.href, '_blank')
    },
    // 跳转相似标准
    getXs (sid) {
      let routeData = this.$router.resolve({path: '/standdetail', query: {id: sid}})
      window.open(routeData.href, '_blank')
    },
    // 起草单位util
    getDraftUtil (util) {
      // console.log(util)
      let routeData = this.$router.resolve({path: '/seniorsearch', query: {DraftingUnit: util}})
      window.open(routeData.href, '_blank')
    },
    // 起草人utilp
    geDraftPeo (people) {
      let routeData = this.$router.resolve({path: '/seniorsearch', query: {DraftingPeople: people}})
      window.open(routeData.href, '_blank')
    },
    // 退出
    logout () {
      this.$cookie.delete('user')
      let routeUrl = this.$router.resolve({
        path: '/'
      })
      window.open(routeUrl.href)
    },
    // 预览pdf
    readpdf () {
      // let routeUrl = this.$router.resolve({
      //   path: 'http://172.168.16.247:8099/Template/333.pdf'
      // })
      // window.open('http://172.168.16.247:8099/Template/333.pdf', '_blank')
      if (this.textaddress === '' || this.textaddress === undefined) {
        this.$Message.error('抱歉当前标准电子文档正在收录!')
      } else {
        let routeUrl = this.$router.resolve({
          path: '/pdf', query: {textaddress: this.textaddress}
        })
        window.open(routeUrl.href, '_blank')
      }
    },
    // 下载pdf
    downpdf () {
      let sid = this.$route.query.id
      // 判断是否有文件
      if (this.textaddress === '' || this.textaddress === undefined) {
        this.$Message.error('抱歉当前标准文章正在收录!')
      } else {
        // let upload = { data: this.textaddress }
        // console.log(this.textaddress)
        // \\IMISINSPUR07\gn\DB15\DB15T1332-2018FDIS.pdf
        // \\IMISINSPUR07\GN\GB\20000-22000\GB_T 34620-2017.pdf
        // \\IMISINSPUR07\gn\GB\GB_T 34620-2017.pdf
        // 6
        // let textdddress = this.textaddress.split('\\')
        // textdddress[0] = '1'
        // textdddress[1] = '1'
        // let addressstr = ''
        // console.log(textdddress)
        // textdddress.forEach(function (val, index, arr) {
        //   addressstr += val + '/'
        // })
        // this.textaddress = addressstr
        let textpath = this.textaddress.split('\\')
        let telg = parseInt(textpath.length)
        console.log(textpath)
        // \\IMISINSPUR07\GN\GB\20000-22000\GB_T 34620-2017.pdf
        // 7
        // \\IMISINSPUR07\gn\GB\GB_T 34620-2017.pdf
        // 6
        let texttotal = textpath[telg - 3] + ',' + textpath[telg - 2] + ',' + textpath[telg - 1]
        console.log(texttotal)
        let upload = { data:
        '{standardId: ' + "'" + sid + "'" +
        ', standardNum: ' + "'" + this.standnum + "'" +
        ', userId: ' + "'" + this.userinfo.id + "'" +
        ', standardCn: ' + "'" + this.standname + "'" +
        ', textaddress: ' + "'" + texttotal + "'" +
        '}' }
        console.log(upload)
        this.$axios.post(neturl + '/by/standard/down', upload).then(res => {
          console.log(res)
          // var a = document.createElement('a')
          // a.download = '标准'
          // a.href = 'http://' + res.result
          // a.target = '_blank'
          // // a.setAttribute('id', 'export')
          // document.getElementById('test').append(a) // 修复firefox中无法触发click
          // a.click()
          // 创建a标签
          console.log(res.data.data.info)
          console.log(res.data.data.result)
          const link = document.createElement('a')
          // download属性
          link.setAttribute('download', res.data.data.info)
          link.setAttribute('target', '_blank')
          // href链接
          link.setAttribute('href', 'http://' + res.data.data.result)
          // 自执行点击事件
          link.click()
          // document.body.removeChild(link)
          // let URL = this.dataURLtoBlob(res.data.data.result)
          // var reader = new FileReader()
          // reader.readAsDataURL(URL)
          // reader.onload = function (e) {
          //   // 兼容IE
          //   if (window.navigator.msSaveOrOpenBlob) {
          //     var bstr = atob(e.target.result.split(',')[1])
          //     var n = bstr.length
          //     var u8arr = new Uint8Array(n)
          //     while (n--) {
          //       u8arr[n] = bstr.charCodeAt(n)
          //     }
          //     var blob = new Blob([u8arr])
          //     window.navigator.msSaveOrOpenBlob(blob, res.data.data.info)
          //   } else {
          //     // 转换完成，创建一个a标签用于下载
          //     var a = document.createElement('a')
          //     a.download = res.data.data.info
          //     a.href = e.target.result
          //     a.setAttribute('id', 'export')
          //     document.getElementById('purchaseManage').append(a) // 修复firefox中无法触发click
          //     a.click()
          //     // document.getElementById('export').remove()
          //   }
          // }
        })
      }
    },
    qq () {
      // 此处分享链接内无法携带图片
      const share = {
        title: '内蒙古标准化研究院',
        desc: this.standname,
        share_url: 'https://xiucai.neafex.com/#/'
      }
      location.replace(
        'https://connect.qq.com/widget/shareqq/index.html?url=' +
          encodeURIComponent(share.share_url) +
          '&title=' +
          share.title +
          '&desc=' +
          share.desc
      )
    },
    weibo () {
      // 自定义内容
      const share = {
        title: '内蒙古标准化研究院',
        image_url: ['https://xxx.jpeg'],
        share_url: 'https://地址'
      }
      // 跳转地址
      location.replace(
        'https://service.weibo.com/share/share.php?url=' +
          encodeURIComponent(share.share_url) +
          '&title=' +
          share.title +
          '&pic=' +
          share.image_url +
          '&searchPic=true'
      )
    },
    dataURLtoBlob (dataurl) {
      var bstr = atob(dataurl)
      var n = bstr.length
      var u8arr = new Uint8Array(n)
      while (n--) {
        u8arr[n] = bstr.charCodeAt(n)
      }
      return new Blob([u8arr], { type: 'pdf' })
    },
    // 添加购物车
    addshopcar () {
      // 需要登录
      if (!this.islogin) {
        this.$Message.error('请先登录!')
        this.$router.push('/login')
      }
      this.shopcount += 1
      let sid = this.$route.query.id
      let upload = { data:
      '{member_id: ' + "'" + this.userinfo.userId + "'" +
      ', standardId: ' + "'" + this.standnum + "'" +
      ', standardName: ' + "'" + this.standname + "'" +
      ', standardPages: ' + "'" + this.standardPages + "'" +
      ', cartType: ' + "'" + 'Standard' + "'" +
      ', price: ' + "'" + this.standardPages * 1.5 + "'" +
      ', product_id: ' + "'" + sid + "'" +
      '}' }
      // console.log(upload)
      this.$axios.post(neturl + '/by/shopcar/add?token=' + this.userinfo.token + '&loginMark=' + this.userinfo.loginMark, upload
      ).then(res => {
        // console.log(res)
        if (res.data.code === 200) {
          this.$Message.success('购物车添加成功')
        } else {
          this.$Message.error(res.data.info)
        }
      })
    },
    // 判断是否购买标准
    judgeIsBuy () {
      if (this.userinfo != null) {
        let upload = { data:
        '{uid: ' + "'" + this.userinfo.userId + "'" +
        ', standnum: ' + "'" + this.standnum + "'" + '}' }
        this.$axios.post(neturl + '/by/order/getByUidSnum?token=' + this.userinfo.token + '&loginMark=' + this.userinfo.loginMark, upload
        ).then(res => {
          // console.log(res)
          this.$Spin.hide()
          if (res.data.data.result.length > 0) {
            this.isbuy = true
          }
        })
      }
    }
  },
  created () {
    this.$Spin.show()
    this.id = this.$route.query.id
    // this.keyword = this.$route.query.keyword
    this.org = this.$route.query.org
    // if (this.org === 'DB15') {
    //   let reg = new RegExp('-', 'g')
    //   this.id = this.id.replace(reg, '')
    //   // todo
    // }
    let uploadaa = { data: this.id }
    this.$axios.post(neturl + '/by/standard/getById', uploadaa).then(res => {
      console.log(res)
      this.standard = res.data.data.result
      this.standname = this.standard.Cn
      this.enname = this.standard.En
      this.standnum = this.standard.StandNum
      this.standardPages = this.standard.Pages
      this.isd = this.standard.Isd
      this.efd = this.standard.Efd
      this.categorycode = this.standard.CategoryCode
      if (this.standard.DraftingUnit != null && this.standard.DraftingUnit.includes('、')) {
        this.DraftingUnit = this.standard.DraftingUnit.split('、')
      }
      if (this.standard.DraftingUnit != null && this.standard.DraftingUnit.includes(';')) {
        this.DraftingUnit = this.standard.DraftingUnit.split(';')
      }
      this.PublishingUnit = this.standard.PublishingUnit
      this.RecordNumber = this.standard.RecordNumber
      this.AbolitionDate = this.standard.AbolitionDate
      this.StandStatus = this.standard.StandStatus
      this.scope = this.standard.Scope
      this.ics = this.standard.Ics
      this.ccs = this.standard.Ccs
      this.substitutedStandard = this.standard.SubstitutedStandard
      this.textaddress = this.standard.TextAddress
      if (this.standard.zb_a001 === '' || this.standard.zb_a001 === null) {
      } else {
        this.DraftingPeople = this.standard.zb_a001.split('、')
      }
      // 判断是否购买标准
      this.judgeIsBuy()
      // 赋值子项
      this.childrenlist = this.standard.childList
      this.childrenguifan = sortKey(this.childrenlist, 'n_docum')
      this.childrenfulu = sortKey(this.childrenlist, 'app_id')
      this.childrenshuyu = sortKey(this.childrenlist, 't_id')
      this.childrenmuci = sortKey(this.childrenlist, 'clg_id')
      this.childrenjiegou = sortKey(this.childrenlist, 'tech_itid')
      // console.log(this.childrenlist)
      // 获取标准结构化树形数据
      let uploadjiego = { data: '{id: ' + "'" + this.id + "'" + ', tablename: ' + "'" + this.standard.TableName + "'" + '}' }
      // console.log(upload)
      this.$axios.post(neturl + '/by/standard/getStructureById', uploadjiego
      ).then(ress => {
        // console.log(ress)
        this.baseData = ress.data.data.result
      })
      // 获取相似标准
      if (this.ccs !== undefined) {
        let upload = { data: '{ssnum: ' + "'" + "'" +
        ', scn: ' + "'" + "'" +
        ', sen: ' + "'" + "'" +
        ', sics: ' + "'" + "'" +
        ', sccs: ' + "'" + this.ccs + "'" +
        ', sstatus: ' + "'" + "'" +
        ', orgn: ' + "'" + "'" +
        ', agenumber: ' + "'" + "'" +
        ', sfenlei: ' + "'" + "'" +
        ', sisd: ' + "'" + "'" +
        ', sefd: ' + "'" + "'" +
        ', sdfu: ' + "'" + "'" +
        ', sdfp: ' + "'" + "'" +
        ', page: ' + 1 +
        ', pagesize: ' + 10 +
        '}' }
        // console.log(upload)
        this.$axios.post(neturl + '/by/search/gs', upload
        ).then(ress => {
          this.$Spin.hide()
          // console.log(res)
          this.xiangsilist = ress.data.data.rows
          // this.$Spin.hide()
        })
      } else {
        this.$Spin.hide()
      }
    })
    // this.model1 = this.cityList[0].value
    this.userinfo = this.$cookie.get('user')
    this.userinfo = JSON.parse(this.userinfo)
    // console.log(this.userinfo)
    // 已登录
    if (this.userinfo != null) {
      this.islogin = true
      this.islog = false
      this.username = this.userinfo.realName
    }
    // 获取购物车商品数量
    // let uuupload = { data: this.userinfo.userId }
    // this.$axios.post(neturl + '/by/shopcar/getbyId?token=' + this.userinfo.token + '&loginMark=' + this.userinfo.loginMark, uuupload
    // ).then(res => {
    //   console.log(res)
    //   this.shopcount = res.data.data.alen
    // })
  }
}
function sortKey (array, key) {
  return array.sort(function (a, b) {
    var x = a[key]
    var y = b[key]
    return ((x < y) ? -1 : (x > y) ? 1 : 0)
  })
}
</script>

<style scoped>
  @import '../assets/css/standdetail.css';
</style>
